<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
            "http://www.w3.org/TR/html4/strict.dtd">

<jsp:directive.page errorPage="/WEB-INF/mayberry/ErrorPage.jsp"/>
<jsp:directive.page import="java.util.*"/>
<jsp:directive.page import="org.twndmv.dto.*"/>
<html>
    <title>Add Person Form</title>
    <body>
        <h2>Add DMV Person to POI DB</h2>
        
        <jsp:scriptlet>
            String handler = request.getContextPath() + "/mayberry";
        </jsp:scriptlet>
        
        <form method="POST"
            action="<%= handler %>">
            ID of DMV Person:  <input type="text" name="id" size="25" value=""/><p/>
            <jsp:scriptlet>
              List people = (List)request.getAttribute("sampleIds");
              String sampleIds = "";
              if(people.size() == 0) {
                sampleIds = "Empty DB, populate first";
              } else {
              for(Object o : people) {
            	  PersonDTO p = (PersonDTO)o;
            	  sampleIds += p.getId() + ", ";
              }
                sampleIds = sampleIds.substring(0, sampleIds.length() - 2);
              }
            </jsp:scriptlet>
            <p style="font:italic">Note: Some example ids include: <%= sampleIds %></p>
            <input type="submit" name="command" value="Add DMV Person"/>
        </form>
        </body>
        </html>
        